using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableArticleCategory
	{
		public const string Table = "ArticleCategory";
		public const string ArticleCategoryId = "ArticleCategoryId";
		public const string ArticleCategoryName = "ArticleCategoryName";
		public const string ArticleCategorySort = "ArticleCategorySort";
		public const string Created = "Created";
		public const string Creater = "Creater";
		public const string Modified = "Modified";
		public const string Modifieder = "Modifieder";
	}
	
	[Serializable]
	public class BaseArticleCategory
		: IDbSessionEntity, IJsonClass
	{
		int m_ArticleCategoryId;
		/// <summary>
        /// 
        /// </summary>
        public int ArticleCategoryId
        {
            get { return m_ArticleCategoryId; }
            set { m_ArticleCategoryId = value; }
        }
		
		string m_ArticleCategoryName;
		/// <summary>
        /// 分类名称
        /// </summary>
        public string ArticleCategoryName
        {
            get { return m_ArticleCategoryName; }
            set { m_ArticleCategoryName = value; }
        }
		
		int m_ArticleCategorySort;
		/// <summary>
        /// 分类排序
        /// </summary>
        public int ArticleCategorySort
        {
            get { return m_ArticleCategorySort; }
            set { m_ArticleCategorySort = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 创建人
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		DateTime? m_Modified;
		/// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		int? m_Modifieder;
		/// <summary>
        /// 修改人
        /// </summary>
        public int? Modifieder
        {
            get { return m_Modifieder; }
            set { m_Modifieder = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_ArticleCategoryId = reader[TableArticleCategory.ArticleCategoryId];
            m_ArticleCategoryName = reader[TableArticleCategory.ArticleCategoryName];
            m_ArticleCategorySort = reader[TableArticleCategory.ArticleCategorySort];
            m_Created = reader[TableArticleCategory.Created];
            m_Creater = reader[TableArticleCategory.Creater];
            m_Modified = reader[TableArticleCategory.Modified];
            m_Modifieder = reader[TableArticleCategory.Modifieder];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableArticleCategory.ArticleCategoryId, PrimaryKeyType.Identity, ArticleCategoryId);
			writer[TableArticleCategory.ArticleCategoryName] = ArticleCategoryName;
			writer[TableArticleCategory.ArticleCategorySort] = ArticleCategorySort;
			writer[TableArticleCategory.Created] = Created;
			writer[TableArticleCategory.Creater] = Creater;
			writer[TableArticleCategory.Modified] = Modified;
			writer[TableArticleCategory.Modifieder] = Modifieder;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_ArticleCategoryId = idd;
        }
		
		public string TableName
        {
            get { return TableArticleCategory.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_ArticleCategoryId = hashToRead["ArticleCategoryId"];
			 
             m_ArticleCategoryName = hashToRead["ArticleCategoryName"];
			 
             m_ArticleCategorySort = hashToRead["ArticleCategorySort"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_Modifieder = hashToRead["Modifieder"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["ArticleCategoryId"] = ArticleCategoryId;
			 
            hashToFill["ArticleCategoryName"] = ArticleCategoryName;
			 
            hashToFill["ArticleCategorySort"] = ArticleCategorySort;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["Modifieder"] = Modifieder;
			 
        }

        #endregion
		
	}
}
